import {request, handleFetchResultNotification, REQUEST_TYPE} from '../utils';
import stringify from 'Shared/utils/stringify';
import {formatMessage} from './intl';

const baseUrl = '/afterSales/api/v1';
const resourceName = formatMessage({
    id: 'api.resourceName',
    defaultMessage: '索赔索赔业务一览表'
});

const getListDesc = formatMessage({
    id: 'api.message.getListDesc',
    defaultMessage: '查询{resourceName}'
}, {resourceName});

// 查询索赔业务一览表
export const getList = condition => {
    const queryString = stringify(condition);
    return request(`${baseUrl}/expenseAdjustmentClaims?${queryString}`, null, null)
        .then(handleFetchResultNotification(REQUEST_TYPE.query, getListDesc));
};

